﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SPGenesis.Entities;
using Mitc.Portal.Core.Entitys.Calendar;

namespace Mitc.Portal.Core.Entitys.Calendar
{
    public class CalendarMaping:SPGENEntityMap<CalendarEntity>
    {
        protected override void InitializeMapper()
        {

            RegisterIdentifierProperty(p => p.ID);
            MapField(p => p.Title, "Title");
            MapField(p => p.NewsContents, CalendarIntance.NewsContents.InternalName);
            MapField(p => p.Concern, CalendarIntance.Concern.InternalName);
            MapField(p => p.FromDate, CalendarIntance.FromDate.InternalName);
            MapField(p => p.Sponsor, CalendarIntance.Sponsor.InternalName);
            MapField(p => p.Address, CalendarIntance.Address.InternalName);
            MapField(p => p.ObjectMain, CalendarIntance.ObjectMain.InternalName);
            MapFieldToEnum<CalendarType>(p => p.TypeOfCal, CalendarIntance.TypeOfCal.InternalName, SPGENEntityEnumMappingOptions.ChoiceMappings);
        }
    }
}
